<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateContractsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('contracts', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('cid')->index()->default(0);                 // 客户ID

            $table->string('contract_no')->unique();                     // 合同号
            $table->text('contract');                                    // 合同内容

            $table->boolean('invoice_status')->default(0);               // 发票状态
            $table->boolean('invoice_type')->default(1);                 // 发票类型 【普票，增票】

            $table->text('invoice_receipt');                             // 发票回执内容
            $table->boolean('invoice_receipt_status')->default(0);       // 发票回执状态

            $table->text('remark');                                      // 备注
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('contracts');
    }
}
